home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8504.arc
/
SMALL.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-09-14
|
2KB
|
76 lines
Page 60,132
Title SMALL -- Load EGA 8x8 Font for 25 or 43 Line Screens
Subttl Thomas V. Hoffmann, January 1985
;--This program selects 80x25 alpha color mode (mode 3), loads the
; EGA character generator with the 8x8 font, and causes BIOS to
; recalculate the video parameters for maximum screen dimensions.
;
; With 350-line displays, this gives 43 lines per screen.
; With 200-line displays, this gives 25 lines per screen.
;
Stack segment para stack 'stack'
dw 64 dup (0)
Stack Ends
Bdata segment at 40H ;-- BIOS data segment
org 63H
CRTC dw ? ; Base I/O address of CRTC
org 87H
info db ? ; Bit 0=1 inhibits cursor emulation
Bdata Ends
Code segment para public 'code'
Small proc far
Push es ; Push ES:0 for return to DOS
Sub ax,ax
Push ax
Mov ax,Bdata ; Set DS to BIOS data segment
Mov ds,ax
assume ds:Bdata
Mov ax,0003H ; Set 80-column alpha mode
Int 10H
Mov ax,1112H ; Load 8x8 font
Mov bl,0 ; into block 0
Int 10H ; and recalc screen
; This code sets the EGA CRTC cursor register directly, after
; inhibiting the BIOS cursor emulation function. On 350-line
; displays, this prevents BIOS from setting the cursor to lines
; 11 and 12, which are not displayed for 8-line characters.
Or info,1 ; Inhibit cursor emulation
Mov ax,0100H ; Set cursor
Mov bh,0 ; for page 0
Mov cx,0600H ; to last two lines
Int 10H ; (start on 6, off on 0)
page
; This code sets the underline location register in the CRTC to
; the last line of the character box (line 7). BIOS incorrectly
; sets it to line 8, which is not displayed.
Mov dx,CRTC ; Get CRTC base address
Mov al,14H ; Select underline loc register
Out dx,al
Inc dx ; Point DX to CRTC data register
Mov al,7 ; Set underline loc to line 7
Out dx,al
; This code enables the EGA BIOS print screen routine, which
; can handle non-standard display dimensions. In this case
; it handles 43 lines of characters on 350-line displays.
Mov ax,1200H ; Select EGA screen print
Mov bl,20H ; routine
Int 10H
Ret ; Return to DOS
Small Endp
Code Ends
End